package eerbaar.internal.elements.extension;

import eerbaar.elements.extension.IPointConsumer;
import eerbaar.extension.IExtensible;

public class PointConsumerImpl implements IPointConsumer {

    private final IExtensible parent;
    private final Priority priority;
    private final int pointsToTake;

    public PointConsumerImpl(IExtensible parent, Priority priority,
            int pointsToTake) {
        this.parent = parent;
        this.priority = priority;
        this.pointsToTake = pointsToTake;
    }

    @Override
    public IExtensible copy() {
        return new PointConsumerImpl(this.parent, this.priority,
                this.pointsToTake);
    }

    @Override
    public <T extends IExtensible> T getExtension(Class<T> type) {
        return parent.getExtension(type);
    }

    @Override
    public int getPointsToTake() {
        return this.pointsToTake;
    }

    @Override
    public Priority getPriority() {
        return priority;
    }

}
